package com.easy.dn.ui.main.presenter;

import com.easy.common.baserx.RxSubscriber;
import com.easy.dn.bean.ResumeChat;
import com.easy.dn.bean.ResumeDetailBean;
import com.easy.dn.ui.main.contract.ResumeDetailContract;

import java.util.Map;

/**
 * Created by 丁宁
 * on 2017/8/8.
 */

public class ResumeDetailPresenter extends ResumeDetailContract.Presenter {
    @Override
    public void getData(Map<String, String> map) {
        mRxManage.add(mModel.getResumeDetailData(map).subscribe(new RxSubscriber<ResumeDetailBean>(mContext,true) {
            @Override
            protected void _onNext(ResumeDetailBean resumeDetailBean) {
                mView.returnResumeDetailDta(resumeDetailBean);
            }

            @Override
            protected void _onError(String message) {
                mView.showErrorTip(message);
            }
        }));
    }

    @Override
    public void getIsChatData(Map<String, String> map) {
        mRxManage.add(mModel.getIsChat(map)
                .subscribe(new RxSubscriber<ResumeChat>(mContext,true) {
            @Override
            protected void _onNext(ResumeChat resumeChat) {
                mView.returnIsChat(resumeChat.isReject());
            }

            @Override
            protected void _onError(String message) {
                mView.showErrorTip(message);
            }
        }));
    }
}
